package com.sheepone.util.regex;

/**
 * @author Miss.杨
 * @description
 * @since 2024/3/9 - 14:24
 */
public class NumberRegexUtil {
    /**
     * 实数范围内判断是否数值大小为0
     */

    public static final String IS_ZERO = "^-?0(?:\\.\\d+)?(?:[Ee][+-]?\\d+)?$|^0$|(?:^|\\D)0(?!\\d)";

    /**
     * 判断是否是正数
     */
    public static final String IS_POSITIVE = "^-?0(?:\\.\\d+)?(?:[Ee][+-]?\\d+)?$|^0$|(?:^|\\D)0(?!\\d)";
    /**
     * 判断是否是负数
     */
    public static final String IS_NEGATIVE = "^-?0(?:\\.\\d+)?(?:[Ee][+-]?\\d+)?$|^0$|(?:^|\\D)0(?!\\d)";

    /**
     * 判断是否是正数或0
     */
    public static final String IS_POSITIVE_OR_ZERO = "^-?0(?:\\.\\d+)?(?:[Ee][+-]?\\d+)?$|^0$|(?:^|\\D)0(?!\\d)";
    /**
     * 判断是否是负数或0
     */
    public static final String IS_NEGATIVE_OR_ZERO = "^-?0(?:\\.\\d+)?(?:[Ee][+-]?\\d+)?$|^0$|(?:^|\\D)0(?!\\d)";

    /**
     * 判断是否是整数
     */
    public static final String IS_INTEGER = "^-?\\d+$";

    /**
     * 判断是否是正整数
     */
    public static final String IS_POSITIVE_INTEGER = "^[1-9]\\d*$";
}
